<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>幸运大转盘</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
        }
        
        .container {
            text-align: center;
            background: rgba(255, 255, 255, 0.95);
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
        }
        
        h1 {
            color: #333;
            margin-bottom: 30px;
            font-size: 2.5em;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .wheel-container {
            position: relative;
            width: 350px;
            height: 350px;
            margin: 0 auto 30px;
        }
        
        .wheel {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            position: relative;
            overflow: hidden;
            border: 8px solid #fff;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
            transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
        }
        
        .wheel-section {
            position: absolute;
            width: 50%;
            height: 50%;
            transform-origin: right bottom;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 16px;
            color: white;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
        }
        
        .wheel-section:nth-child(1) {
            background: #ff6b6b;
            transform: rotate(0deg);
        }
        
        .wheel-section:nth-child(2) {
            background: #4ecdc4;
            transform: rotate(60deg);
        }
        
        .wheel-section:nth-child(3) {
            background: #45b7d1;
            transform: rotate(120deg);
        }
        
        .wheel-section:nth-child(4) {
            background: #96ceb4;
            transform: rotate(180deg);
        }
        
        .wheel-section:nth-child(5) {
            background: #feca57;
            transform: rotate(240deg);
        }
        
        .wheel-section:nth-child(6) {
            background: #ff9ff3;
            transform: rotate(300deg);
        }
        
        .pointer {
            position: absolute;
            top: -20px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 20px solid transparent;
            border-right: 20px solid transparent;
            border-top: 40px solid #ff4757;
            z-index: 10;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
        }
        
        .spin-button {
            background: linear-gradient(45deg, #ff6b6b, #ff4757);
            color: white;
            border: none;
            padding: 15px 40px;
            font-size: 20px;
            font-weight: bold;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
        }
        
        .spin-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
        }
        
        .spin-button:active {
            transform: translateY(0);
        }
        
        .spin-button:disabled {
            background: #ccc;
            cursor: not-allowed;
            box-shadow: none;
        }
        
        .result {
            margin-top: 20px;
            font-size: 24px;
            font-weight: bold;
            color: #333;
            min-height: 30px;
        }
        
        .confetti {
            position: fixed;
            width: 10px;
            height: 10px;
            background: #ff6b6b;
            position: absolute;
            animation: confetti-fall 3s linear;
        }
        
        @keyframes confetti-fall {
            to {
                transform: translateY(100vh) rotate(360deg);
                opacity: 0;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>🎉 幸运大转盘 🎉</h1>
        <div class="wheel-container">
            <div class="pointer"></div>
            <div class="wheel" id="wheel">
                <div class="wheel-section">一等奖</div>
                <div class="wheel-section">二等奖</div>
                <div class="wheel-section">三等奖</div>
                <div class="wheel-section">谢谢参与</div>
                <div class="wheel-section">幸运奖</div>
                <div class="wheel-section">特别奖</div>
            </div>
        </div>
        <button class="spin-button" id="spinButton" onclick="spin()">开始抽奖</button>
        <div class="result" id="result"></div>
    </div>

    <script>
        let isSpinning = false;
        const prizes = ['一等奖', '二等奖', '三等奖', '谢谢参与', '幸运奖', '特别奖'];
        
        function spin() {
            if (isSpinning) return;
            
            isSpinning = true;
            const wheel = document.getElementById('wheel');
            const spinButton = document.getElementById('spinButton');
            const result = document.getElementById('result');
            
            spinButton.disabled = true;
            result.textContent = '';
            
            // 随机旋转角度（至少转5圈）
            const randomDegree = Math.floor(Math.random() * 360) + 1800;
            wheel.style.transform = `rotate(${randomDegree}deg)`;
            
            setTimeout(() => {
                // 计算最终角度
                const finalDegree = randomDegree % 360;
                const prizeIndex = Math.floor((360 - finalDegree + 30) / 60) % 6;
                const prize = prizes[prizeIndex];
                
                result.textContent = `🎊 恭喜获得：${prize}！🎊`;
                
                if (prize !== '谢谢参与') {
                    createConfetti();
                }
                
                isSpinning = false;
                spinButton.disabled = false;
            }, 4000);
        }
        
        function createConfetti() {
            const colors = ['#ff6b6b', '#4ecdc4', '#45b7d1', '#96ceb4', '#feca57', '#ff9ff3'];
            
            for (let i = 0; i < 50; i++) {
                setTimeout(() => {
                    const confetti = document.createElement('div');
                    confetti.className = 'confetti';
                    confetti.style.left = Math.random() * 100 + '%';
                    confetti.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
                    confetti.style.animationDelay = Math.random() * 0.5 + 's';
                    document.body.appendChild(confetti);
                    
                    setTimeout(() => confetti.remove(), 3000);
                }, i * 50);
            }
        }
    </script>
</body>
</html>